package com.snailhd.config;

import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.config.listener.Listener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import java.util.concurrent.Executor;

/**
 * @author hd
 * @description
 * @date 2019-11-17 16:36
 */

@Configuration
public class ConfigListener {

//    @Resource
//    ConfigService configService;

//    @Value("${snailhd.iot.listener.dataId}")
//    public String dataId;
//
//    @Value("${snailhd.iot.listener.group}")
//    public String group;

    public void listener() throws Exception{
//        String content = configService.getConfig(dataId, group, 5000);
//        configService.addListener(dataId, group, new Listener() {
//            @Override
//            public void receiveConfigInfo(String configInfo) {
//                System.out.println("recieve:" + configInfo);
//            }
//
//            @Override
//            public Executor getExecutor() {
//                return null;
//            }
//        });
    }
}
